package com.freewater.springboot.demo.resource.autowire;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.io.IOException;

public class Main {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(AppConfig.class);
        applicationContext.registerShutdownHook();
        final SomeService someService = applicationContext.getBean(SomeService.class);
        try {
            someService.printTextFile();
        } catch (IOException e) {
            System.out.println(e.getMessage());
        }
    }
}
